---
title: algo.Cache
api: algo.Cache
---

## Description

<Summary/>

There are 2 ways to fill the cache. First, you can use [set()](/reference/api/algo/Cache/set) to directly add a key-value pair to it. Second, you can provide a callback function that is called with a key and returns the corresponding value when [get()](/reference/api/algo/Cache/get) could not find an entry.

## Constructor

<Constructor/>

## Methods

<Methods/>

## See Also

* [algo](/reference/api/algo)
